package my.bean;

import java.util.Date;

/**
 * 购物车类
 * 属性:id,cid,gid,buytime,buycount  [cart_id,customer_id,goods_id,buy_time,buy_count]
 * 操作:构造器   getter 和 setter 方法
 * @author slim
 *
 */
public class Cart {
	private int id;
	private Customer customer;
	private Goods good;
	private Date buyTime;
	private int buyCount;

	public Cart(int id, int cid, int gid, Date buyTime, int buyCount) {
		super();
		this.id = id;
		this.customer = new Customer();
		this.customer.setUserId(cid);
		this.good = new Goods();
		this.good.setGid(gid);
		this.buyTime = buyTime;
		this.buyCount = buyCount;
	}

	public Cart(int cid, int gid, Date buyTime, int buyCount) {
		super();
		this.customer = new Customer();
		this.customer.setUserId(cid);
		this.good = new Goods();
		this.good.setGid(gid);
		this.buyTime = buyTime;
		this.buyCount = buyCount;
	}

	public Cart(Customer customer, Goods good, Date buyTime, int buyCount) {
		super();
		this.customer = customer;
		this.good = good;
		this.buyTime = buyTime;
		this.buyCount = buyCount;
	}

	public Cart(int id, Customer customer, Goods good, Date buyTime, int buyCount) {
		super();
		this.id = id;
		this.customer = customer;
		this.good = good;
		this.buyTime = buyTime;
		this.buyCount = buyCount;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Goods getGood() {
		return good;
	}

	public void setGood(Goods good) {
		this.good = good;
	}

	public Cart() {
		super();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getCid() {
		return this.customer.getUserId();
	}

	public void setCid(int cid) {
		this.customer.setUserId(cid);
	}

	public int getGid() {
		return this.good.getGid();
	}

	public void setGid(int gid) {
		this.good.setGid(gid);
	}

	public Date getBuyTime() {
		return buyTime;
	}

	public void setBuyTime(Date buyTime) {
		this.buyTime = buyTime;
	}

	public int getBuyCount() {
		return buyCount;
	}

	public void setBuyCount(int buyCount) {
		this.buyCount = buyCount;
	}

}
